package com.ipbd.controller;

import com.ipbd.domain.BreathRecord;
import com.ipbd.service.BreathRecordService;
import com.ipbd.utils.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/breath")
@Slf4j
public class BreathRecordController {

    @Autowired
    private BreathRecordService breathRecordService;

    /**
     * 添加呼吸记录表
     * @return
     */
    @PostMapping("/saveBreath")
    public R saveBreathRecord(@RequestBody BreathRecord breathRecord) {
        return breathRecordService.saveBreathRecord(breathRecord);
    }

    /**
     * 查询呼吸记录表
     * @return
     */
    @GetMapping("/selectBreath")
    public R selectBreathRecord() {
        return breathRecordService.selectBreathRecord();
    }

    @GetMapping("/selectAllBreath")
    public R selectAllBreathRecord() {
        return breathRecordService.selectAllBreathRecord();
    }
}
